home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 2: CDPD 1
/
Almathera Ten on Ten - Disc 2: CDPD 1.iso
/
pd
/
201-225
/
223
/
iff2sun
/
iff2sun.doc
< prev
next >
Wrap
Text File
|
1995-03-13
|
9KB
|
265 lines
IFF2SUN(1) UNIX UTILITIES IFF2SUN(1)
NAME
iff2sun/convert - Amiga to Sun rasterfile conversion program
SYNOPSIS
iff2sun [-chp] [infile] [outfile]
if infile is not specified stdin is used. if outfile
is not specified then stdout is used.
-c yields a color rasterfile (greyscale is the
default).
-h switches extra half-bright mode on.
-p enables horizontal pixel replication. This
switch is usefull for lores and HAM pictures to
offset the aspect ratio difference between the two
machines (also EHB).
convert [-c n] [-f] infile outfile
the (in/out)files MUST be entered (or you get an error
message).
-c n Set the output colortable to n entries. The
default is 256 colors.
-f Use Floyd-Steinberg dithering on the output.
DESCRIPTION
IFF2SUN & CONVERT
What's it do? This little guy reads an Amiga IFF ILBM file
and outputs Sun rasterfile format. GIGO (Georgous In
Garbage Out).
For HAM pictures it simply outputs an RGB color file
that the Sun WILL NOT UNDERSTAND. You then need to run
another program called convert to format it into a Sun
rasterfile.
To properly use this program, you must unshar the
distribution and type 'make'. Place the binaries in a
convient directory. MAKE your executables on a Sun! It
does you very little good to try to compile this on your
Amiga.
Convert takes a partly converted iff file, generated by
iff2sun, and converts it the rest of the way to produce a
Sun rasterfile. The only supported and tested use of
convert is convert in out. The other documented switches
that the program accepts are not tested at this time.
CONVERTING A HAM PICTURE:
In order to do conversion from a HAM Iff to a Sun
readable file format, I had to find a routine that would do
color quantization from 4096 colors to 256. I was able to
Checkered Ball -1- Version 1.4
IFF2SUN(1) UNIX UTILITIES IFF2SUN(1)
modify a program released in '82 at SIGGRAPH to do this
function. Unfortuneately, integrating this into iff2sun
would prove to be too much trouble. Instead I modified
iff2sun to detect when it was working on a HAM picture, and
do a straight RGB color dump, and then use the secondary
program to finish doing the color quantization. So, when
you want to do HAM conversion, follow a sequence like this:
iff2sun -cp porche930 porche930.out
convert porche930.out porche930.pic
The resulting porche930.pic, in this case, will be a Sun
readable 8 bit plane rasterfile. You can then go and do
some dithering or whatever it is that you want to do. There
is a supplied script called hamtosun that will do all of the
standard things to convert a ham picture.
Iff2sun outputs an 8 bitplane sun rasterfile with a
color table, (EXCEPT WHEN A HAM PICTURE IS DETECTED, THEN
YOU NEED TO RUN CONVERT ) which defaults to shades of gray.
Using the -c color flag will put the IFF Amiga color table
into the rasterfile. If you want to display this on a
monochrome tube (which is what I have) you should go through
the folowing steps:
1> iff2sun inputfile outputfile
2> rastrepl outputfile output.bigger
3> rasfilter8to1 -d output.bigger output.mono
The rastrepl just pixel replicates the image so that it is
large enough to see the detail. you can run this as many
times as you like, but remember the image quadruples each
time you use it. Most sane people will only run it once.
NOTE: For HAM conversion you NEED to include the -c
switch. The color tables are used internally to simulate
the Amiga HAM mode.
The rasfilter8to1 program converts the color file (8
bit planes) to mono (1 plane) and does some fancy dithering
(-d). To prepare an image for a color system, just include
the -c switch and either display it as it is, or replicate
it to the desired size first.
Both the rastrepl and rasfilter8to1 program are part of
a standard Sun release. They should be included on your
system.
Using Extra-half-bright or HAM mode, or any 320x400
format will produce an image that will looked elongated on a
Sun screen. There are several ways to fix this. The
easiest is to convert your pictures to 640x400 mode and then
display them. The second easiest is to rip out 1/3 of the
horizontal scan lines in the resultant image. The third is
to have ME write iff2sun to pixel replicate horizontally to
offset the aspect ratio change. If the third option is the
only one acceptable to you, then you are in luck. All you
have to do is run iff2sun with the -p switch on the command
Checkered Ball -2- Version 1.4
IFF2SUN(1) UNIX UTILITIES IFF2SUN(1)
line. You will now get pictures that will look somewhat
better in this 320 (lo-res) mode. Remember, the executable
at this time only pixel-replicates in the horizontal
direction. That means that a pixel replicated 640 (hi-res)
image will come out 1280x400 before you do anything to it.
It is recommended that you pixel replicate your HAM
pictures.
Limitations:
I have only tested this on DPaintII images, it is very
possible that it might break with other formats. Unlikely,
but possible :*)
Revision History:
10/31/88 First release, does only simple conversion and no
color.
12/88 Re-released with color support. Unfortunately few if
any one saw this release (it got lost on the way to the
moderator) This modification is Mark's claim to fame.
4/26/89 Added Extra-half-bright support, also looking for
the best way to convert HAM (4096) to 8 bit (256) format.
Also stuck in the pixel replicating code (trivial).
5/26/89 Added HAM mode conversion (with convert) and fixed
an iff parsing bug (parse()), and added new argument parsing
supplied by Tony Schene. The original convert.c was supplied
by Tony Kennedy as well as the bug report on DPaintIII
images.
AUTHORS
This Program created (under tremendous pressure) by
Steve Berry with help and modifications by Mark Thompson,
Tony Schene and Tony Kennedy.
I hope you guys keep it clean. (If you don't, let me know
:-)
Steve Berry ...sun!kilowatt!raz
or raz%kilowatt.EBay@sun.com or even BIX: razberry
Mark Thompson ...decvax!savax!thompson
-------
This is the revision 2 update information as posted by Mark
Thompson.
Well I said I would do it, so here it is....the modified and
improved version of iff2sun. The following changes have
been made:
Checkered Ball -3- Version 1.4
IFF2SUN(1) UNIX UTILITIES IFF2SUN(1)
1) Can now convert IFF images up to 1024 lines vertical
resolution.
(horizontal res is still 1024)
2) Improved greyscale contrast.
3) Now generates a Sun Rasterfile colormap.
4) Supports either greyscale or color output.
As for the problems some people have been having with the
notorious 'compression messed' error, it seems this is due
to certain implementations of kermit. Binary mode kermit in
vt100 on the Amiga does work. If you don't have any luck
with this method, uuencode seems to perform flawlessly.
Mark Thompson
decvax!savax!thompson
Checkered Ball -4- Version 1.4